import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()],
  server: {
    proxy: {
      '/api': {               // 访问/api开头的请求
        target: 'http://localhost:8080',  // 转发到后端服务
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '') // 可选：去掉/api前缀
      }
    }
  }
})
